﻿using Fast;
using System;

namespace Microsoft.Extensions.DependencyInjection
{
    /// <summary>
    /// 依赖注入特性
    /// </summary>
    [SkipScan, AttributeUsage(AttributeTargets.Class)]
    public class DependencyAttribute : Attribute
    {
        /// <summary>
        /// 生命周期
        /// </summary>
        public virtual ServiceLifetime Lifetime { get; set; }
        /// <summary>
        /// 默认 ServiceLifetime.Transient 生命周期
        /// </summary>
        /// <param name="lifetime"></param>
        public DependencyAttribute(ServiceLifetime lifetime = ServiceLifetime.Transient)
        {
            Lifetime = lifetime;
        }

    }
}
